<%--
  Created by IntelliJ IDEA.
  User: EZTTU
  Date: 2022/4/24
  Time: 17:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>

<head>
    <title>更新书籍信息</title>
    <!-- 新 Bootstrap 核心 CSS 文件 -->
    <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <style>
        .photo {
            width: 109px;
            height: 122px;
            margin-left: 930px;
        }

        .fileinp {
            width: 109px;
            -webkit-background-size: cover;
            background-size: cover;
            position: relative;
        }

        .upload {
            width: 109px;
            height: 30px;
            text-align: center;
            color: #333;
            line-height: 30px;
        }

        .file-up {
            opacity: 0;
            position: absolute;
            top: 5px;
            right: -102px;
            cursor: pointer;
        }

        .photo img {
            width: 109px;
            height: 122px;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1>
                    <small>书籍信息修改</small>
                </h1>
            </div>
        </div>
        <div class="row">
            <div class="col-md-4 column">
                <a class="btn btn-primary" href="${pageContext.request.contextPath}/book/query">回到主页面</a>
            </div>
        </div>

        <form action="${pageContext.request.contextPath}/book/updateBook" method="post" enctype="multipart/form-data">
            <div class="photo">

                <img class="instruction-pic" id="instruction-pic"
                     src="${book.coverPath}"
                     alt="">
                <div class="fileinp">
                    <div class="upload">修改封面</div>
                    <%--                <input type="file" id="file-up" class="file-up">--%>
                    <input type="file" id="file-up" class="file-up" name="file"
                           accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">

                </div>
            </div>
            <br>
            <input type="hidden" name="bookID" value="${book.bookID}">
            <input type="hidden" name="coverPath" value="${book.coverPath}">
            <div class="form-group">
                <label for="bookName">书籍名称：</label>
                <input type="text" class="form-control" id="bookName" name="bookName" placeholder="名称"
                       value="${book.bookName}" required>
            </div>
            <div class="form-group">
                <label for="author">书籍作者：</label>
                <input type="text" class="form-control" id="author" name="author" placeholder="图书作者"
                       value="${book.author}" required>
            </div>
            <div class="form-group">
                <label for="bookCounts">书籍库存：</label>
                <input type="text" class="form-control" id="bookCounts" name="bookCounts" placeholder="库存"
                       value="${book.bookCounts}" required>
            </div>
            <div class="form-group">
                <label for="detail">书籍描述：</label>
                <input type="text" class="form-control" id="detail" name="detail" placeholder="图书细节"
                       value="${book.detail}" required>
            </div>
            <div class="form-group">
                <label for="detail">书籍类型：</label>
                <input type="text" class="form-control" id="bookType" name="bookType" placeholder="图书类型"
                       value="${book.bookType}" required>
            </div>
            <div class="form-group">
                <label for="detail">每日价格：</label>
                <input type="text" class="form-control" id="price" name="price" placeholder="图书单价" value="${book.price}"
                       required>
            </div>
            <button type="submit" class="btn btn-info btn-lg btn-block">提交</button>
        </form>
    </div>
</div>

</body>
</html>
